package com.example.demo.service.impl;

import com.example.demo.dao.CouponDao;
import com.example.demo.pojo.Coupon;
import com.example.demo.service.CouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("couponService")
public class CouponServiceImpl implements CouponService {

    @Autowired
    private CouponDao couponDao;

    //通过优惠卷类型查询
    @Override
    public List<Coupon> selectByType(String type) {
        return couponDao.selectByType(type);
    }

    @Override
    public int deleteByPrimaryKey(Integer couponid) {
        return couponDao.deleteByPrimaryKey(couponid);
    }

    @Override
    public int insert(Coupon record) {
        return couponDao.insert(record);
    }

    @Override
    public int updateByPrimaryKeySelective(Coupon record) {
        return couponDao.updateByPrimaryKeySelective(record);
    }

    @Override
    public List<Coupon> getAll() {
        return couponDao.getAll();
    }

    @Override
    public Coupon selectByPrimaryKey(Integer couponid) {
        return couponDao.selectByPrimaryKey(couponid);
    }


}
